﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Ranet.AgOlap.Core.MetadataDescription;

namespace Galaktika.BI.Silverlight.Controls.General.Tree
{
    public class MeasureTreeNode : CustomTreeNode
    {
        MeasureInfo m_Info = null;
        public MeasureInfo Info
        {
            get {
                return m_Info;
            }
        }

        public MeasureTreeNode(MeasureInfo info)
        {
            if (info == null)
                throw new ArgumentNullException("info");
            
            m_Info = info;
            Text = info.Caption;

            if (String.IsNullOrEmpty(info.Expression))
            {
                Icon = UriResources.Images.Measure16;
            }
            else
            {
                Icon = UriResources.Images.MeasureCalc16;
            }
        }
    }
}
